<template>
    <div class="layui-row" >

        <product  :data="pageconfig.data"></product>
        <lay-page @change="change" v-model="pageconfig.page"  theme="blue" :limit="pageconfig.limit" :total="pageconfig.total" :show-page="true"></lay-page>
    </div>
</template>
<script lang="ts" setup>
import { ref } from 'vue'

import http from 'webosutils/lib/http';
import taobao from '../../components/card/taobao.vue';
import music from '../../components/card/music.vue';
import applet from '../../components/card/applet.vue';
import randomnew from '../../components/card/randomnew.vue';
import product from '../../components/card/product.vue';
const newsmian=ref({data:[],title:''}) as any;
const pageconfig=ref({
  limit:12,
  page:1,
  total:0,
  search:{
    title:""
  },
  data:{title:"",data:[]}
});
const ajax = () => {

http.post("/v1/api/portalsite/GetNew", {title:pageconfig.value.search.title,type: "70895c54-2cad-4bd2-bbc6-9be4367551fa",  page: pageconfig.value.page, limit: pageconfig.value.limit },"请稍等").then(res => {

    pageconfig.value.total=res.count;
    pageconfig.value.data.data = Object.freeze( res.data);
    pageconfig.value.data.title="我的作品";
    var win=window as any;
    win.scrollTo(0,0)

}).catch(res => {

})



}
ajax();
const change=( page:any)=>{
  debugger;
  pageconfig.value.page=page.current;
  pageconfig.value.limit=page.limit;
  ajax();
}
const a_search=()=>{
  pageconfig.value.page=1;
  ajax();
}
</script>
